Assignment operator
Just as the simple assignment operator = returns the value that it stored, all of the assignment operators return the value stored in the variable on the left-hand-side.
//these four variables represent the sides of a rectangle
int left;
int top;
int right;
int bottom;
//make it a square whose sides are 4
left = top = right = bottom = 4;
An example above shows how it can be taken advantage of this return value.
All this code does is store the value in each of the four variables left, top, right, and bottom. How does it work? It starts on the far right-hand side. It sees bottom = 4. So it places the value 4 in the variable bottom, and returns the value it stored in bottom (which is 4). Since bottom = 4 evaluates to 4, the variable right will also get the value 4, which means top will also get 4, which means left will also get 4. Phew! Of course, this code could have just as easily been written //these four variables represent the sides of a rectangle int left; int top; int right; int bottom; //make it a square whose sides are 4 left = 4; top = 4; right = 4; bottom = 4; and it would have done the exact same thing. The first way is more compact, and you're more likely to see it written the first way. But both ways are equally correct, so use whichever you prefer.